#ifndef Exception_First
#define Exception_First
#ifdef __GNUG__
#pragma interface
#endif

#include "ET_setjmp.h"

struct ExceptionContext {
	jmp_buf buf;
};

#define TRY \
	{ \
		ExceptionContext *__old= gException, __curr; \
		int __code; \
		gException= &__curr; \
		if ((__code= sigsetjmp(gException->buf, 1)) == 0) {

#define CATCH(n) \
			gException= __old; \
		} else { \
			int n= 0; n= __code; \
			gException= __old;

#define ENDTRY \
		} \
	}

extern ExceptionContext *gException;

extern void Throw(int code);

#endif
